package com.sci99.ex;

import java.io.IOException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Button;
import org.zkoss.zul.Window;

import com.sci99.ex.util.MyBatisUtil;

public class TestWindowComposer extends GenericForwardComposer<Window> {
	static final Logger log = Logger.getLogger(TestWindowComposer.class
			.getName());
	Button testBtn;

	public void onClick$testBtn() {
		URL url;
		try {
			url = new URL("jndi:/localhost/ex/WEB-INF/zk-label.properties");
			System.out.println(url.openStream());
		} catch (IOException e) {
			log.log(Level.SEVERE, e.getMessage());
		}

		log.log(Level.INFO, "someting");
		System.out.println("someting");
	}

	public void onClick$testBtn3() {
		try {
			MyBatisUtil.getH2Session().update("TestSQL");
		} catch (IOException e) {
			log.log(Level.SEVERE, e.getMessage());
		}
	}
}
